    function updateTableWithBackendData(dataArray, MEDIA_URL) {
        // 获取表格的tbody元素
        console.log(dataArray)
        const tbody1 = document.getElementById('show_1').querySelector('.el-table__body tbody');
        const tbody2 = document.getElementById('show_2').querySelector('.el-table__body tbody');
        // 清空现有行数据
        tbody1.innerHTML = '';
        tbody2.innerHTML = '';

        // 遍历后端数据数组并更新表格
        console.log(dataArray.length)
        if (dataArray.length === 0) {
            moveshape1(0);
            moveShapes();
            alert('该地区暂无原始数据');
        } else {
            dataArray.forEach((item, index) => {
                // 创建新行
                const newRow = document.createElement('tr');
                newRow.className = 'el-table__row';

                // 创建复选框单元格
                const checkboxCell = document.createElement('td');
                checkboxCell.className = 'el-table_2_column_3 el-table-column--selection';
                checkboxCell.innerHTML = '<td rowspan="1" colspan="1" class="el-table_2_column_3  el-table-column--selection">\n' +
                    '                                        <div class="cell">\n' +
                    '                                            <label role="checkbox" class="el-checkbox">\n' +
                    '\t\t\t\t\t\t\t\t\t\t<span aria-checked="mixed" class="el-checkbox__input">\n' +
                    '\t\t\t\t\t\t\t\t\t\t\t<span class="el-checkbox__inner">\n' +
                    '\t\t\t\t\t\t\t\t\t\t\t</span>\n' +
                    '\t\t\t\t\t\t\t\t\t\t\t<input type="checkbox" aria-hidden="true" class="el-checkbox__original" value="">\n' +
                    '\t\t\t\t\t\t\t\t\t\t</span>\n' +
                    '                                                <!---->\n' +
                    '                                            </label>\n' +
                    '                                        </div>\n' +
                    '                                    </td>';
                newRow.appendChild(checkboxCell);

                // 创建图片单元格
                const imageCell = document.createElement('td');
                imageCell.className = 'el-table_2_column_4';
                const image = document.createElement('img');
                image.src = MEDIA_URL + item.imgs; // 更新图片地址
                image.style.cursor = "pointer";
                imageCell.appendChild(image);
                image.style.height = "40px";
                image.style.width = "45px";
                image.style.borderRadius = "6px";
                newRow.appendChild(imageCell);

                // 创建详情单元格
                const detailCell = document.createElement('td');
                detailCell.className = 'el-table_2_column_5';
                const cellDiv = document.createElement('div');
                cellDiv.className = 'cell';
                cellDiv.style.textAlign = 'left';

                // 创建传感器名称链接
                const sensorLink = document.createElement('p');
                sensorLink.style.cursor = 'pointer';
                sensorLink.textContent = item.sce;
                sensorLink.style.overflow = 'hidden'; // 隐藏超出部分
                sensorLink.style.whiteSpace = 'nowrap'; // 单行显示
                sensorLink.style.textOverflow = 'ellipsis'; // 显示省略号
                sensorLink.style.fontWeight = 'bold'; // 设置文本为加粗
                cellDiv.appendChild(sensorLink);

                // 创建字段包裹器并添加字段
                const fieldWrap = document.createElement('div');
                fieldWrap.className = 'field-wrap clearfix';

                const createField = (labelText, value) => {
                    const field = document.createElement('div');
                    field.className = 'field fl';
                    const label = document.createElement('label');
                    label.textContent = labelText + ':';
                    field.appendChild(label);
                    const valueLabel = document.createElement('label');
                    valueLabel.textContent = value;
                    field.appendChild(valueLabel);
                    return field;
                };

                // 添加所属区域、数据号、卫星号、采集时间字段
                fieldWrap.appendChild(createField('所属区域', item.address));
                fieldWrap.appendChild(createField('卫星号', item.satellite));
                fieldWrap.appendChild(createField('采集时间', item.date));

                cellDiv.appendChild(fieldWrap);
                detailCell.appendChild(cellDiv);
                newRow.appendChild(detailCell);
                // 设置行号
                newRow.id = index;
                // 将新行添加到表格的tbody中
                if (item.type === "SAR")
                    tbody1.appendChild(newRow);
                else if (item.type === "OLI")
                    tbody2.appendChild(newRow);
            });
        }
    }


    function sendDataToBackend(position1, startdate, enddate, MEDIA_URL) {
        removing()
        var csrftoken = document.querySelector('[name=csrfmiddlewaretoken]').value;
        $.ajax({
            type: 'POST',
            url: 'index.html',
            data: {
                'position1': position1,
                'startdate': startdate,
                'enddate': enddate,
                'datatype': 1,
                'csrfmiddlewaretoken': csrftoken
            },
            success: function (response) {
                // 处理成功响应
                if (response.error)
                    $('#result').text(response.error);
                let i = 1
                response.scenes.forEach((scene, index) => {
                    scene['imgs'] = response.imgs[index]
                })
                let scenes = response.scenes.map((scene, index) => ({
                    id: i++,
                    sce: scene.scene_id,
                    date: scene.date,
                    address: scene.address,
                    satellite: scene.satellite,
                    type: scene.type,
                    imgs: scene.imgs,
                    bbox: scene.bbox
                }));
                dataBound = scenes;
                console.log(scenes)
                executeScript(response.scenes, response.sc, response.jud, response.boundary);
                updateTableWithBackendData(scenes, MEDIA_URL);
                // 通过替换下面这个配置来生成不同页面
                // let amis = amisRequire('amis/embed');
                // let amisJSON = {
                //     "type": "page",
                //     "body": {
                //         "type": "service",
                //         "data": {
                //             "page": 1,
                //             "perPage": 5,
                //             "items": scenes
                //         },
                //         "body": [
                //             {
                //                 "type": "page",
                //                 "inputName": "page",
                //                 "outputName": "page",
                //                 "perPage": 5,
                //                 "position": "bottom",
                //                 "body": [
                //                     {
                //                         "type": "table2",
                //                         "syncLocation": false,
                //                         "value": scenes,
                //                         "scroll": {
                //                             "y": 200
                //                         },
                //                         "columns": [
                //                             {
                //                                 "name": "id",
                //                                 "label": "ID",
                //                                 "width": 50,
                //                                 "type": "text"
                //                             },
                //                             {
                //                                 "name": "date",
                //                                 "label": "时间",
                //                                 "width": 80,
                //                                 "align": "center",
                //                                 "type": "text"
                //                             },
                //                             {
                //                                 "name": "dataset",
                //                                 "label": "数据集",
                //                                 "align": "center",
                //                                 "width": 60,
                //                                 "type": "text"
                //                             },
                //                             {
                //                                 "name": "type",
                //                                 "label": "数据类型",
                //                                 "align": "center",
                //                                 "type": "text"
                //                             },
                //                             {
                //                                 "title": "图片与分析",
                //                                 "type": "button-group",
                //                                 "buttons": [
                //                                     {
                //                                         "type": "button",
                //                                         "label": "图片",
                //                                         "size": "sm",
                //                                         "onEvent": {
                //                                             "click": {
                //                                                 "actions": [
                //                                                     {
                //                                                         "actionType": "ajax",
                //                                                         "api": {
                //                                                             "method": "get",
                //                                                             "url": 'index.html/${sce}/${dt}',
                //                                                         }
                //                                                     },
                //                                                     {
                //                                                         "actionType": "dialog",
                //                                                         "data": {
                //                                                             "img": "${event.data.responseResult.responseData.img}"
                //                                                         },
                //                                                         "dialog": {
                //                                                             "size": "md",
                //                                                             "title": "图片详情",
                //                                                             "closeOnOutside": true,
                //                                                             "data": {"img": "${img}"},
                //                                                             "actions": [],
                //                                                             "body": [
                //                                                                 {
                //                                                                     "type": "tpl",
                //                                                                     "tpl": "<img style='width:470px; border: 2px solid white;' src='{{ MEDIA_URL }}${img}' alt='暂无' style='display: inline-block;'>",
                //                                                                     "inline": false
                //                                                                 }
                //                                                             ]
                //                                                         }
                //                                                     }
                //                                                 ]
                //                                             }
                //                                         }
                //                                     },
                //                                     {
                //                                         "type": "button",
                //                                         "label": "分析",
                //                                         "size": "sm",
                //                                         "onEvent": {
                //                                             "click": {
                //                                                 "actions": [
                //                                                     {
                //                                                         "actionType": "url",
                //                                                         "args": {
                //                                                             "url": 'tackle.html/${idx}/0',
                //                                                             "blank": false,
                //                                                             "msgType": "info",
                //                                                             "msg": "${event.context.nativeEvent.target.className}"
                //                                                         }
                //                                                     }
                //                                                 ]
                //                                             }
                //                                         }
                //                                     }
                //                                 ],
                //                             }
                //                         ]
                //                     }
                //                 ]
                //             }
                //         ]
                //     }
                // };
                // let amisScoped = amis.embed('#search_result', amisJSON);
            }
        });
    }

    function executeScript(data1 = null, sc = null, jud = 0, boundary = null) {            //之前让地球仪旋转的代码
        if (!data1) {
            return;
        }
        console.log("click");
        if (sc === -1) {
            alert("无该地区信息")
            return;
        }
        moveShapes();
        moveshape1(1);
        if (jud === 0) {                                                //显示点
            let mPoint = new BMapGL.Point(sc["lng"], sc["lat"]);
            marker = new BMapGL.Marker(mPoint);
            map.addOverlay(marker);
            map.enableScrollWheelZoom();
            map.centerAndZoom(mPoint, 8);

            circle = new BMapGL.Circle(mPoint, 50000, {
                fillColor: "blue",
                strokeWeight: 1,
                fillOpacity: 0.4,
                strokeOpacity: 0.5
            });
            map.addOverlay(circle);
        } else if (jud === 1) {                                            //显示区域
            path = []
            let path0 = []
            let point
            for (let j = 0; j < boundary.length; j++) {
                point = new BMapGL.Point(parseFloat(boundary[j][0]), parseFloat(boundary[j][1]))
                path0.push(point)
            }
            mapmask = new BMapGL.MapMask(path0, {
                showRegion: 'inside', // 显示区域范围以内部分
                isBuildingMask: true, // 楼块是否参与掩膜
                isPoiMask: true, // poi标注是否参与掩膜
                isMapMask: true, // 底图是否参与掩膜
                // fillColor: 'rgba(0, 0, 255, 0.1)',
                strokeColor: 'blue',
            });
            map.addOverlay(mapmask);
            map.enableScrollWheelZoom();
            map.centerAndZoom(point, 8);
            path.push(mapmask)
        }
        let data_list = data1;
        rectangles = []
        for (let i = 0; i < data_list.length; i++) {
            let cboxList = data_list[i].cbox;
            let pointsStr = cboxList.substring(2, cboxList.length - 2);
            let points = pointsStr.split('), (').map(function (point) {
                // 分割经度和纬度，并转换为浮点数
                let coordinates = point.split(',').map(function (coord) {
                    return parseFloat(coord.trim());
                });
                return coordinates;
            });
            var rectangle = new BMapGL.Polygon([
                new BMapGL.Point(points[0][0], points[0][1]),
                new BMapGL.Point(points[1][0], points[1][1]),
                new BMapGL.Point(points[3][0], points[3][1]),
                new BMapGL.Point(points[2][0], points[2][1])
            ], {
                strokeColor: 'blue',
                strokeWeight: 1,
                strokeOpacity: 0.4,
                fillOpacity: 0.1,
            });
            rectangles.push(rectangle);
        }
        // Add rectangles to the map
        for (let i = 0; i < rectangles.length; i++) {
            map.addOverlay(rectangles[i]);
        }
    }

    function removing() {
        for (let i = 0; i < rectangles.length; i++) {
            map.removeOverlay(rectangles[i]);
        }
        for (let i = 0; i < path.length; i++) {
            map.removeOverlay(path[i]);
        }
        map.removeOverlay(marker);
        map.removeOverlay(circle);
    }
